/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XPF
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface SindexTemplateRelation extends BasicModel<SindexTemplateRelation> {
  configId?: string; // 关联模板
  indexId?: string; // 关联指标
  sort?: string; // 排序
}

export const sindexTemplateRelationList = (params?: SindexTemplateRelation | any) =>
  defHttp.get<SindexTemplateRelation>({
    url: adminPath + '/sports/sindexTemplateRelation/list',
    params,
  });

export const sindexTemplateRelationListData = (params?: SindexTemplateRelation | any) =>
  defHttp.post<Page<SindexTemplateRelation>>({
    url: adminPath + '/sports/sindexTemplateRelation/listData',
    params,
  });

export const sindexTemplateRelationForm = (params?: SindexTemplateRelation | any) =>
  defHttp.get<SindexTemplateRelation>({
    url: adminPath + '/sports/sindexTemplateRelation/form',
    params,
  });

export const sindexTemplateRelationSave = (params?: any, data?: SindexTemplateRelation | any) =>
  defHttp.postJson<SindexTemplateRelation>({
    url: adminPath + '/sports/sindexTemplateRelation/save',
    params,
    data,
  });

export const sindexTemplateRelationDelete = (params?: SindexTemplateRelation | any) =>
  defHttp.get<SindexTemplateRelation>({
    url: adminPath + '/sports/sindexTemplateRelation/delete',
    params,
  });
